<include file="public/layout" />
<body style="background-color: #FFF; overflow: auto;">
<div id="toolTipLayer" style="position: absolute; z-index: 9999; display: none; visibility: visible; left: 95px; top: 573px;"></div>
<div id="append_parent"></div>
<div id="ajaxwaitid"></div>
<div class="page">
    <div class="fixed-bar">
        <div class="item-title"><a class="back" href="javascript:history.back();" title="返回列表"><i class="fa fa-arrow-circle-o-left"></i></a>
            <div class="subject">
                <h3>合伙人类型管理 - 编辑会员类型</h3>
                <h5>网站系统合伙人类型管理</h5>
            </div>
        </div>
    </div>
    <form class="form-horizontal" id="handleposition" method="post">
        <input type="hidden" name="act" value="{$act}">
        <input type="hidden" name="type_id" value="{$info.type_id}">
        <div class="ncap-form-default">
            <dl class="row">
                <dt class="tit">
                    <label for="type_name"><em>*</em>类型名称</label>
                </dt>
                <dd class="opt">
                    <input type="text" name="type_name" value="{$info.type_name}" id="type_name" class="input-txt">
                    <span class="err" id="err_type_name"></span>
                    <p class="notic">设置合伙人类型名称</p>
                </dd>
            </dl>
            <!--<dl class="row">-->
                <!--<dt class="tit">-->
                    <!--<label for="amount"><em>*</em>消费额度</label>-->
                <!--</dt>-->
                <!--<dd class="opt">-->
                    <!--<input type="text" name="amount" value="{$info.amount}" id="amount" class="input-txt" onkeyup="this.value=/^\d+\.?\d{0,2}$/.test(this.value) ? this.value : ''">-->
                    <!--<span class="err" id="err_amount"></span>-->
                    <!--<p class="notic">设置会员等级所需要的消费额度,单位：元</p>-->
                <!--</dd>-->
            <!--</dl>-->
            <dl class="row">
                <dt class="tit">
                    <label for="Proportion"><em>*</em>分佣比例</label>
                </dt>
                <dd class="opt">
                    <input type="text" name="Proportion" value="{$info.Proportion}" id="Proportion" class="input-txt" onkeyup="this.value=this.value.replace(/[^\d]/g,'')">
                    <span class="err" id="err_Proportion"></span>
                    <p class="notic">分佣比例单位为百分比，如输入90，表示该会员等级的用户可以以商品原价的90%购买</p>
                </dd>
            </dl>
            <dl class="row">
                <dt class="tit">
                    <label for="Proportion1"><em>*</em>直推分佣比例</label>
                </dt>
                <dd class="opt">
                    <input type="text" name="Proportion1" value="{$info.Proportion1}" id="Proportion1" class="input-txt" onkeyup="this.value=this.value.replace(/[^\d]/g,'')">
                    <span class="err" id="err_Proportion1"></span>
                    <p class="notic">分佣比例单位为百分比，如输入90，表示该会员等级的用户可以以商品原价的90%购买</p>
                </dd>
            </dl>
            <dl class="row">
                <dt class="tit">
                    合伙人类型描述
                </dt>
                <dd class="opt">
                    <textarea  name="describe" class="tarea" rows="6">{$info.describe}</textarea>
                    <span class="err" id="err_describe"></span>
                    <p class="notic">合伙人类型描述信息</p>
                </dd>
            </dl>
            <div class="bot"><a href="JavaScript:void(0);" onclick="verifyForm()" class="ncap-btn-big ncap-btn-green" id="submitBtn">确认提交</a></div>
        </div>
    </form>
</div>
<script type="text/javascript">
    function verifyForm(){
        $('span.err').show();
        $.ajax({
            type: "POST",
            url: "{:U('Admin/User/typeHandle')}",
            data: $('#handleposition').serialize(),
            dataType: "json",
            error: function () {
                layer.alert("服务器繁忙, 请联系管理员!");
            },
            success: function (data) {
                if (data.status == 1) {
                    layer.msg(data.msg, {icon: 1});
                    location.href = "{:U('Admin/User/typeList')}";
                } else {
                    layer.msg(data.msg, {icon: 2});
                    $.each(data.result, function (index, item) {
                        $('#err_' + index).text(item).show();
                    });
                }
            }
        });
    }
</script>
</body>
</html>